package Homework.Top1.Test2;

import java.util.Objects;

public class Member {
//    公司有很多员工（用List存储），员工有姓名，年龄，性别，职务，薪水、工号等属性
private String meName;
    private int meAge;
    private String meSex;
    private String meWork;
    private double money;
    private String workNum;

public  Member(){}
    public Member(String meName, int meAge, String meSex, String meWork, double money, String workNum) {
        this.meName = meName;
        this.meAge = meAge;
        this.meSex = meSex;
        this.meWork = meWork;
        this.money = money;
        this.workNum = workNum;
    }

    public String getMeName() {
        return meName;
    }

    public void setMeName(String meName) {
        this.meName = meName;
    }

    public int getMeAge() {
        return meAge;
    }

    public void setMeAge(int meAge) {
        this.meAge = meAge;
    }

    public String getMeSex() {
        return meSex;
    }

    public void setMeSex(String meSex) {
        this.meSex = meSex;
    }

    public String getMeWork() {
        return meWork;
    }

    public void setMeWork(String meWork) {
        this.meWork = meWork;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double menoy) {
        this.money = menoy;
    }

    public String getWorkNum() {
        return workNum;
    }

    public void setWorkNum(String workNum) {
        this.workNum = workNum;
    }


    public String toString(){
        return meName+"\t"+meSex+"\t"+meWork+"\t"+money+"\t"+workNum;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Member)) return false;
        Member member = (Member) o;
        return workNum.equals(member.workNum);
    }

    @Override
    public int hashCode() {
        return Objects.hash(workNum);
    }
}
